﻿using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace HomeCloudStorageSystem.Models
{
    /// <summary>
    /// 文件信息模型
    /// </summary>
    [Table("FileInfo")]
    public class FileInfos
    {
        /// <summary>
        /// 文件ID
        /// </summary>
        [Key]
        public int Id { get; set; }
        /// <summary>
        /// 文件名
        /// </summary>
        [Required(ErrorMessage = "文件名不能为空")]
        public string FileName { get; set; }
        /// <summary>
        /// 扩展名
        /// </summary>
        [Required(ErrorMessage = "文件扩展名不能为空")]
        public string ExtName { get; set; }
        /// <summary>
        /// 文件路径
        /// </summary>
        [Required(ErrorMessage = "文件路径不能为空")]
        public string FilePath { get; set; }
        /// <summary>
        /// 父级文件（目录）ID
        /// </summary>
        [Required(ErrorMessage = "父级文件ID不能为空")]
        public int DirectoryId { get; set; }
        /// <summary>
        /// 上传时间
        /// </summary>
        [Required(ErrorMessage = "上传时间不能为空")]
        public string UploadTime { get; set; }
        /// <summary>
        /// 上传人
        /// </summary>
        [Required(ErrorMessage = "文件上传人员不能为空")]
        public int Uploader { get; set; }
        /// <summary>
        /// 文件上传记录ID
        /// </summary>
        [Required(ErrorMessage ="文件上传记录不能为空")]
        public int FileUploagLogId { set; get; }
    }
}
